import Vue from "vue";
import "normalize.css/normalize.css";
import App from "./App";
import router from "./router";
import { message } from "@/utils/reset-message";
import fileters from "@/utils/fileters";
import store from "./store";

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI);

Vue.prototype.$message = message;
Vue.prototype.msgSuccess = function (msg) {
    this.$message({ showClose: true, message: msg, type: "success" });
};
Vue.prototype.msgWarning = function (msg) {
    this.$message({ showClose: true, message: msg, type: "warning", duration: 2000 });
};

Vue.config.productionTip = false;
// 注册过滤器
for (const key in fileters) {
    if (fileters.hasOwnProperty(key)) {
        Vue.filter(key, fileters[key]);
    }
}

// 注册所有版式
// var nowTemplateModuleArr = require.context(`@/views/now-template/`, false, /\.js$/);
// Vue.prototype.$nowTemplateModuleArr = nowTemplateModuleArr;

Vue.prototype.$electron = require("electron");

new Vue({
    el: "#app",
    router,
    store,
    render: (h) => h(App),
});
